import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import nl.ansuz.android.steam.dota.request.DotaRequest;
import nl.ansuz.android.steam.dota.request.match.GetMatchDetails;
import nl.ansuz.android.steam.dota.request.match.GetMatchHistory;
import nl.ansuz.android.steam.dota.response.match.GetMatchHistoryResponse;
import nl.ansuz.android.steam.request.SteamRequest;
import nl.ansuz.android.steam.util.GsonUtil;

import com.google.gson.Gson;


public class GetMatchHistoryTest {
	public static void main(String[] args) throws IOException {
		GetMatchHistory getMatchHistory = new GetMatchHistory();
		Map<String, String> params = new HashMap<String, String>();
		params.put(SteamRequest.Parameter.API_KEY, "18755ABB58C0BE96815AE471FBB1C3F2");
	//	  params.put("start_at_match_id", "316550965");
		//  params.put("account_id","111931499");
  	 //params.put("date_max","1379706022");
		 						 
		//  params.put("date_max","1378771200");
		 // params.put("start_at_match_id", "508");
		//params.put("skill", "1");
		String url = getMatchHistory.createRequestUrl(DotaRequest.ApplicationID.LIVE, params);
		
		//System.out.println(url);
		
		String resopnse = ManipulaHttp2.executaConsulta(url);
		// System.out.println(resopnse);
		
		GsonUtil gsonUtil = new GsonUtil();
		
		Gson gson = new Gson();
		
		GetMatchHistoryResponse getMatchHistoryResponse = gson.fromJson(gsonUtil.getStrippedDotaResult(resopnse), GetMatchHistoryResponse.class);
		
		System.out.println(getMatchHistoryResponse.numberOfResults+" ");
		
		for (int i=0;i<getMatchHistoryResponse.matches.length;i++)
		{
			System.out.println(getMatchHistoryResponse.matches[i].matchSequenceNumber+" : "+getMatchHistoryResponse.matches[i].matchId+" : "+getMatchHistoryResponse.matches[i].startTime);
		}
		
		
		
	}
}
